<template>
  <el-container>
    <!-- 头部区域 -->
    <el-header>
      <div class="header_left">
        <img src="../assets/img/1.jpeg" alt="" />
        <span>品优购后台管理系统</span>
        <el-menu
          class="el-menu-demo"
          mode="horizontal"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          router
        >
          <el-menu-item index="index" >首页</el-menu-item>
          <el-menu-item index="platform">平台</el-menu-item>
          <el-menu-item index="shop">商城</el-menu-item>
          <el-menu-item index="operator">运营</el-menu-item>
        </el-menu>
      </div>
      <span class="name">{{username}}</span>
      <span @click='tc'>退出登录</span>
    </el-header>
    <!-- 子组件显示位置 -->
    <router-view></router-view>
  </el-container>
</template>
<script>
export default {
    data(){
      return{
        username:window.sessionStorage.getItem("name")
      }
    },
    methods:{
      tc(){
        window.sessionStorage.clear();
        this.$router.push('/login');
      }
    },
    mounted() {
      
    },
};
</script>
<style  scoped>
.name{
  position: absolute;
  right: 100px;
}
</style>